package com.sch.hsy.system.service.impl;

import com.sch.hsy.common.core.domain.entity.SysChapter;
import com.sch.hsy.system.mapper.SysChapterMapper;
import com.sch.hsy.system.service.ISysChapterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 章节管理 服务实现
 */
@Service
public class SysChapterServiceImpl implements ISysChapterService {

    @Autowired
    private SysChapterMapper sysChapterMapper;


    @Override
    public List<SysChapter> selectChapterList(Long bookId) {
        return sysChapterMapper.selectChapterList(bookId);
    }

    @Override
    public int insertChapter(SysChapter chapter) {
        return sysChapterMapper.insertChapter(chapter);
    }

    @Override
    public int deleteChapterById(Long chapterId) {
        return sysChapterMapper.deleteChapterById(chapterId);
    }

    @Override
    public int deleteChapterByIds(Long[] ids) {
        return sysChapterMapper.deleteChapterByIds(ids);
    }

    @Override
    public List<Map<String, Object>> selectChapterRecordList(Long userId, Long bookId, Long chapterId) {
        return sysChapterMapper.selectChapterRecordList(userId, bookId, chapterId);
    }

    @Override
    public Long selectChaptersWithUsers() {
        return sysChapterMapper.selectChaptersWithUsers();
    }
}
